<%@ include file="/common/taglibs.jsp"%>
<%@ page pageEncoding="utf-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title><bean:message key="user.common.title.label" />
		</title>
		<link rel="stylesheet" type="text/css"
			href="../styles/sasis/style.css">
		<%@ include file="/scripts/common.js"%>
	</head>
	<body>
		<bean:define id="form" name="userInfoBean"
			type="com.sasis.webapp.form.UserInfoBean" />
		<html:form action="/manage/userRightSet.shtml" styleId="userInfoBean"
			method="post">

			<table border="0" cellspacing="0" cellpadding="10" class="width100">
				<tr>
					<td style="padding-bottom:0px; padding-top:5px;">

						<table border="0" cellspacing="0" cellpadding="0" align="right">
							<tr>
								<td class="but_left">
									&nbsp;
								</td>
								<td class="but_mid">
									<a href="#"
										onclick="javascript:selected();formSubmit(document.forms[0],'./userRightSetAdd.shtml?action=userRightAdd'); "><bean:message
											key="common.button.update" />
									</a>
								</td>
								<td class="but_right">
									&nbsp;
								</td>
								<td class="but_kong">
									&nbsp;
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table border="0" cellspacing="0" cellpadding="5"
							class="width100 listable">
							<html:hidden property="id" />
							<tr>

								<td width="110" class="leftd">
									<bean:message key="user.right.set.label" />
									:
								</td>
								<td class="rightd">
									<html:select property="funcId" multiple="true"
										style="width:15em">
										<html:optionsCollection name="form" property="rightList" />
									</html:select>
								</td>
								<td bgcolor="#FFFFFF">
									<p align="center">
										<input name="Submit3" type="button"
											value="<bean:message key="button.add"/> >>"
											onClick="addItem(document.all.funcId,document.all.funcName)">
									</p>
									<p align="center">
										<input name="Submit4" type="button"
											value="<< <bean:message key="button.delete"/>"
											onClick="delItem(document.all.funcId,document.all.funcName)">
									</p>
								</td>
								<td width="110" class="leftd">
									<bean:message key="user.right.selected.label" />
									:
								</td>
								<td class="rightd">
									<html:select property="funcName" multiple="true"
										style="width:15em">
										<html:optionsCollection name="form" property="rtRightList" />
									</html:select>
								</td>
							</tr>



						</table>
					</td>
				</tr>
			</table>
			<html:hidden property="aryId" />
			<html:hidden property="seledId" />
		</html:form>
		<script> 
 	function selected(){
		var len =  document.forms[0].funcName.options.length; 
		 
		var ary = new Array();
		for(i=0;i<len;i++){
			var aa = document.forms[0].funcName.options[i].value;
			
			ary.push(aa);
 
		}
					document.forms[0].aryId.value = ary;
 	}
</script>
	</body>

	<p>

		<font color="red"> <html:errors />
			<br> </font>
		<!-- Support for non-traditional but simple message -->
		<logic:present name="message">
			<li>
				<font color="blue"><bean:write name="message" />
				</font>
			</li>
		</logic:present>

		<!-- Support for non-traditional but simpler use of errors... -->
		<logic:present name="errors">
			<logic:iterate id="error" name="errors">
				<li>
					<font color="red"><bean:write name="error" />
					</font>
				</li>
			</logic:iterate>
		</logic:present>
</html>
